Learn R Programming

VeryLargeIntegers (version 0.1.8)

09. Greatest common divisor: Greatest Common Divisor for vli Objects

Description

gcd computes and returns the greatest common divisor of two vli (Very Large Integers) objects.

Usage

gcd(x, y)

# S3 method for default gcd(x, y)

# S3 method for numeric gcd(x, y)

# S3 method for vli gcd(x, y)

Value

object of class vli

Arguments

x

object of class vli or 32 bits integer

y

object of class vli or 32 bits integer

Author

Javier Leiva Cuadrado

Examples

Run this code
x <- as.vli("1225312091263347514461245")
y <- as.vli("357590484262521")
gcd(x, y)

Run the code above in your browser using DataLab